﻿--10 - Найти всех дедушек у которых есть сын 

SELECT DISTINCT [ID], [LastName], [Name], [fk_fatherID]
from [MyFamily].[dbo].[Persons]
where [ID] in
(
SELECT DISTINCT A1.[fk_fatherID]
from [MyFamily].[dbo].[Persons] as A1, [MyFamily].[dbo].[Persons] as A2
where ((A1.ID = A2.fk_fatherID))
)
